package com.hhd.bysj.controller;


import com.hhd.bysj.po.Info;
import com.hhd.bysj.service.ReserveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RequestMapping("/")
public class ReserveController {

    @Autowired
    ReserveService service;

    @RequestMapping("/")
    public String home(){
        return "index.html";
    }


    @RequestMapping("/reserve")
    public String reserve(Info info){
        service.toReserve(info);
        System.out.println(info.toString());
        return "redirect:index.html";
    }
}
